package com.yi.gostockgo.controller;


import com.yi.gostockgo.common.BaseMessage;
import com.yi.gostockgo.controller.vo.BaseVo;
import com.yi.gostockgo.controller.vo.GoNewsVo;
import com.yi.gostockgo.service.GoNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 新闻通知公告和广告 前端控制器
 * </p>
 *
 * @author liandyao
 * @since 2020-04-28
 */
@RestController
@RequestMapping("/goNews")
public class GoNewsController {


    @Autowired
    private GoNewsService newsService;

    /**
     * 分页查询公告
     * @param goNewsVo
     * @return
     */
    @GetMapping("/get")
    public BaseMessage pagingQuery(GoNewsVo goNewsVo) {
        if (goNewsVo.getPage() == null) goNewsVo.setPage(0);
        if (goNewsVo.getLimit() == null) goNewsVo.setLimit(5);
        return BaseMessage.getBaseSuccess(newsService.pagingQuery(goNewsVo));
    }
}

